package com.core.framework.tools.reflect;

import java.lang.reflect.Method;

public class BeanReflectUtil {
	public   static  Method getMethod(Class<?> clazz, String name) {
        for (Class<?> superClass = clazz; superClass != Object.class; superClass = superClass.getSuperclass()) {
            try {
            	if(!superClass.getName().contains("EnhancerBySpring"))
                return superClass.getDeclaredMethod(name);
            } catch (Exception e) {
                // Field不在当前类定义,继续向上转型
            }
        }
        return null;
    }
    
}
